/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cr.ac.una.sive.entidad;

import java.io.Serializable;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Collection;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author claribel
 */
@Entity
@Table(name = "RESERVACION_GENERAL", catalog = "", schema = "UNA_SIVE")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "ReservacionGeneral.findAll", query = "SELECT r FROM ReservacionGeneral r"),
    @NamedQuery(name = "ReservacionGeneral.findByIdReservacionGeneral", query = "SELECT r FROM ReservacionGeneral r WHERE r.idReservacionGeneral = :idReservacionGeneral"),
    @NamedQuery(name = "ReservacionGeneral.findByNombre", query = "SELECT r FROM ReservacionGeneral r WHERE r.nombre = :nombre"),
    @NamedQuery(name = "ReservacionGeneral.findByCedula", query = "SELECT r FROM ReservacionGeneral r WHERE r.cedula = :cedula"),
    @NamedQuery(name = "ReservacionGeneral.findByApellido1", query = "SELECT r FROM ReservacionGeneral r WHERE r.apellido1 = :apellido1"),
    @NamedQuery(name = "ReservacionGeneral.findByApellido2", query = "SELECT r FROM ReservacionGeneral r WHERE r.apellido2 = :apellido2"),
    @NamedQuery(name = "ReservacionGeneral.findByEstacionamientoAsignado", query = "SELECT r FROM ReservacionGeneral r WHERE r.estacionamientoAsignado = :estacionamientoAsignado"),
    @NamedQuery(name = "ReservacionGeneral.findByTipoReservacion", query = "SELECT r FROM ReservacionGeneral r WHERE r.tipoReservacion = :tipoReservacion"),
    @NamedQuery(name = "ReservacionGeneral.findByCargoMotivo", query = "SELECT r FROM ReservacionGeneral r WHERE r.cargoMotivo = :cargoMotivo"),
    @NamedQuery(name = "ReservacionGeneral.findByPlaca", query = "SELECT r FROM ReservacionGeneral r WHERE r.placa = :placa")})
public class ReservacionGeneral implements Serializable {
    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    
    @GeneratedValue(strategy=GenerationType.SEQUENCE, generator = "SQRESERVACION_GENERAL")
    @SequenceGenerator(name="SQRESERVACION_GENERAL", sequenceName = "SQ_RESERVACION_GENERAL",allocationSize=1)
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "ID_RESERVACION_GENERAL", nullable = false, precision = 0, scale = -127)
    private BigDecimal idReservacionGeneral;
    @Size(max = 100)
    @Column(name = "NOMBRE", length = 100)
    private String nombre;
    @Size(max = 100)
    @Column(name = "CEDULA", length = 100)
    private String cedula;
    @Size(max = 100)
    @Column(name = "APELLIDO 1", length = 100)
    private String apellido1;
    @Size(max = 100)
    @Column(name = "APELLIDO 2", length = 100)
    private String apellido2;
    @Column(name = "ESTACIONAMIENTO_ASIGNADO")
    private BigInteger estacionamientoAsignado;
    @Size(max = 100)
    @Column(name = "TIPO_RESERVACION", length = 100)
    private String tipoReservacion;
    @Size(max = 100)
    @Column(name = "CARGO_MOTIVO", length = 100)
    private String cargoMotivo;
    @Column(name = "PLACA")
    private BigInteger placa;
    @OneToMany(mappedBy = "reservacionGeneral", fetch = FetchType.EAGER)
    private Collection<HorarioReservacionGeneral> horarioReservacionGeneralCollection;

    public ReservacionGeneral() {
    }

    public ReservacionGeneral(BigDecimal idReservacionGeneral) {
        this.idReservacionGeneral = idReservacionGeneral;
    }

    public BigDecimal getIdReservacionGeneral() {
        return idReservacionGeneral;
    }

    public void setIdReservacionGeneral(BigDecimal idReservacionGeneral) {
        this.idReservacionGeneral = idReservacionGeneral;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public String getCedula() {
        return cedula;
    }

    public void setCedula(String cedula) {
        this.cedula = cedula;
    }

    public String getApellido1() {
        return apellido1;
    }

    public void setApellido1(String apellido1) {
        this.apellido1 = apellido1;
    }

    public String getApellido2() {
        return apellido2;
    }

    public void setApellido2(String apellido2) {
        this.apellido2 = apellido2;
    }

    public BigInteger getEstacionamientoAsignado() {
        return estacionamientoAsignado;
    }

    public void setEstacionamientoAsignado(BigInteger estacionamientoAsignado) {
        this.estacionamientoAsignado = estacionamientoAsignado;
    }

    public String getTipoReservacion() {
        return tipoReservacion;
    }

    public void setTipoReservacion(String tipoReservacion) {
        this.tipoReservacion = tipoReservacion;
    }

    public String getCargoMotivo() {
        return cargoMotivo;
    }

    public void setCargoMotivo(String cargoMotivo) {
        this.cargoMotivo = cargoMotivo;
    }

    public BigInteger getPlaca() {
        return placa;
    }

    public void setPlaca(BigInteger placa) {
        this.placa = placa;
    }

    @XmlTransient
    public Collection<HorarioReservacionGeneral> getHorarioReservacionGeneralCollection() {
        return horarioReservacionGeneralCollection;
    }

    public void setHorarioReservacionGeneralCollection(Collection<HorarioReservacionGeneral> horarioReservacionGeneralCollection) {
        this.horarioReservacionGeneralCollection = horarioReservacionGeneralCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idReservacionGeneral != null ? idReservacionGeneral.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ReservacionGeneral)) {
            return false;
        }
        ReservacionGeneral other = (ReservacionGeneral) object;
        if ((this.idReservacionGeneral == null && other.idReservacionGeneral != null) || (this.idReservacionGeneral != null && !this.idReservacionGeneral.equals(other.idReservacionGeneral))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "cr.ac.una.sive.entidad.ReservacionGeneral[ idReservacionGeneral=" + idReservacionGeneral + " ]";
    }
    
}
